package flex.cc.uac.service;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.IService;

import cn.hutool.core.lang.tree.Tree;
import flex.cc.base.dto.LoginAuthDto;
import flex.cc.uac.entity.UacMenuEntity;
import flex.cc.uac.vo.ViewMenuVo;

/**
 * 菜单表
 *
 * @author zhangzk
 * @email zhangzhikai@sinosoft.com.cn
 * @date 2020-07-11 22:29:37
 */
public interface UacMenuService extends IService<UacMenuEntity> {

    List<UacMenuEntity> getMenuList(Long userId, Long applicationId);
    List<Tree<Long>> getMenuTree(String comCode, Long applicationId);

    ViewMenuVo getViewVoById(Long id);

    boolean saveUacMenu(UacMenuEntity uacMenu, LoginAuthDto loginAuthDto);

    boolean checkMenuHasChildMenu(Long id);

    boolean deleteUacMenuById(Long id, LoginAuthDto loginAuthDto);

    List<UacMenuEntity> listMenuListByRoleId(Long roleId);

    List<Long> getCheckedMenuList(Long roleId);
    
    /**
     * 根据menuid查询自身和父级菜单
     * @param menuList
     * @return
     */
    List<UacMenuEntity> getMenuTreeByMenuId(List<UacMenuEntity> menuList);
}

